<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS3 Animation 动画</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .container{
        width: 260px;
        margin: 100px auto;
        position: relative;
    }
 
    .container div{
        background-color: red;
        display: inline-block;
        animation-name: example;
        animation-iteration-count: infinite;
        animation-timing-function: steps(4);
        opacity: 0;
    }
    .top{
        width: 100px;
        height: 50px;
        position: absolute;
        left: 10px;
        animation-duration: 1s;
        animation-delay: 1s;
    }
    .left{
        transform: rotate(90deg);
        width: 80px;
        height: 50px;
        position: absolute;
        left: -60px;
        top: 10px;
        animation-duration: 1s;
        animation-delay: 2s;
    }
    .bottom{
        width: 100px;
        height: 50px;
        position: absolute;
        left: -50px;
        top: 80px;
        animation-duration: 1s;
        animation-delay: 3s;
    }
    .right{
        width: 80px;
        height: 50px;
        transform: rotate(90deg);
        position: absolute;
        top: 70px;
        left: 40px;
        animation-duration: 1s;
        animation-delay: 4s;
        
    }
    
    
    @keyframes example{
        from{
            opacity: 0;
        }
        to{
            opacity: 1;
        }
    }

</style>
<body>
    <div class="container">
        <div class="top"></div>
        <div class="right"></div>
         <div class="bottom"></div>
        <div class="left"></div>
    </div>
</body>
</html>